package com.kfm.base.it;

public class Demo01 {

    public static void main(String[] args) {
        // 匿名类
        USB usb = new USB() {
            @Override
            public void charge() {

            }

            @Override
            public void b() {

            }
        };

        // 函数接口, 某一种功能
        Object charge = new Charge() {
            @Override
            public void charge(int b) {
                System.out.println(b);
                System.out.println("充电");
            }
        };

        // lambda 表达式来简写 函数接口的实例化
        Charge c = (e) -> {
            System.out.println(e);
            System.out.println("充电");
        };

        c.charge(10);
        c.test();
    }
}
